/*
 * JAVE - A Java Audio/Video Encoder (based on FFMPEG)
 *
 * Copyright (C) 2008-2009 Carlo Pelliccia (www.sauronsoftware.it)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.vrv.mysqlback;

import java.io.Serializable;

/**
 * Attributes controlling the audio encoding process.
 *
 * @author Carlo Pelliccia
 */
public class MysqldumpAttributes implements Serializable {

    private static final long serialVersionUID = 1L;

    public static String DEFAULT_DUMPPATH;

    static {
        if (OperatingSystemUtils.isWindows()) {
            DEFAULT_DUMPPATH = "C:\\backup";
        } else {
            DEFAULT_DUMPPATH = "/mnt/backup";
        }
    }

    private String host;

    private String username;

    private String password;

    private String databases;

    private String dumpPath = DEFAULT_DUMPPATH;

    private String dumpName;

    private Integer port;

    private String tables;

    public String getHost() {
        return host;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public String getDatabases() {
        return databases;
    }

    public String getDumpPath() {
        return dumpPath;
    }

    public String getDumpName() {
        return dumpName;
    }

    public Integer getPort() {
        return port;
    }

    public String getTables() {
        return tables;
    }

    private MysqldumpAttributes() {
    }

    private MysqldumpAttributes(String host, String username, String password, String databases, String dumpPath, String dumpName, Integer port, String tables) {
        this.host = host;
        this.username = username;
        this.password = password;
        this.databases = databases;
        this.dumpPath = dumpPath;
        this.dumpName = dumpName;
        this.port = port;
        this.tables = tables;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {

        private String host;

        private String username;

        private String password;

        private String databases;

        private String dumpPath = DEFAULT_DUMPPATH;

        private String dumpName;

        private Integer port;

        private String tables;

        Builder host(String host) {
            this.host = host;
            return this;
        }

        Builder username(String username) {
            this.username = username;
            return this;
        }

        Builder password(String password) {
            this.password = password;
            return this;
        }

        Builder databases(String databases) {
            this.databases = databases;
            return this;
        }

        Builder dumpPath(String dumpPath) {
            this.dumpPath = dumpPath;
            return this;
        }

        Builder dumpName(String dumpName) {
            this.dumpName = dumpName;
            return this;
        }

        Builder port(Integer port) {
            this.port = port;
            return this;
        }

        Builder tables(String tables) {
            this.tables = tables;
            return this;
        }


        public MysqldumpAttributes build() {
            return new MysqldumpAttributes(host,username,password,databases,dumpPath,dumpName,port,tables);
        }
    }
}
